# 修改
# 语法: dick[key] = value
dict1 = {'name': 'hello', 'age': 18}
dict1['name'] = 'good'  # {'name': 'good', 'age': 18}
print(dict1)
dict1['age'] = 20  # {'name': 'good', 'age': 20}
print(dict1)
dict1['name'] = 'jir'
print(dict1)

# 新增
# key 存在就是在修改, 不存在就是新增
# 语法; dick[key] = value
dict1['addr'] = '重庆'  # {'name': 'good', 'age': 20, 'addr': '重庆'}
print(dict1)